import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from '../views/login.vue'
import HomeView from '../views/home.vue'
import HelloView from '../views/hello.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/redirect',
    component: HomeView,
    hidden: true,
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/redirect')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: LoginView
  },
  {
    path: '/hello',
    name: 'hello',
    component: HelloView
  },
  {
    path: '/',
    name: 'home',
    component: HomeView
  }
]

const router = new VueRouter({
  routes
})

export default router
